/*
 * Copyright 2011 group coding kata nantes
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package fr.coding.kata.nantes.bowling.commons;

import java.util.concurrent.Callable;

/**
 * This interface exposes methods that implement the Bowling game.
 * <p>
 * With class {@code MyBowling} implementing this interface, you compute the score for a rolls with:
 * </p>
 * <p/>
 * <pre>
 * Integer score = new MyBowling().with(aRolls).call();
 * </pre>
 *
 * @author Sylvain Leduby
 * @since 1.0.0
 */
public interface BowlingInterface extends Callable<Integer> {

    /**
     * Tells the rolls to be computed.
     * <p>
     * Examples:<br />
     * (When scoring "X" indicates a strike, "/" indicates a spare, "-" indicates a miss)
     * <p/>
     * <pre>
     * - "XXXXXXXXXXXX" (12 rolls: 12 strikes) = 10+10+10 + 10+10+10 + 10+10+10 + 10+10+10 + 10+10+10 + 10+10+10 +
     *   10+10+10 + 10+10+10 + 10+10+10 + 10+10+10 = 300
     * - "9-9-9-9-9-9-9-9-9-9-" (20 rolls: 10 pairs of 9 and miss) = 9 + 9 + 9 + 9 + 9 + 9 + 9 + 9 + 9 + 9 = 90
     * - "5/5/5/5/5/5/5/5/5/5/5" (21 rolls: 10 pairs of 5 and spare, with a final 5) = 10+5 + 10+5 + 10+5 + 10+5 +
     *   10+5 + 10+5 + 10+5 + 10+5 + 10+5 + 10+5 = 150
     * </pre>
     * <p/>
     * </p>
     *
     * @param rolls The rolls to use to compute the score.
     * @return The instance of {@link BowlingInterface}.
     */
    BowlingInterface with(String rolls);

}
